package com.demo.websocket.old;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class WebSocketController {

	@RequestMapping("/testwebsocket/{id}")
	public ModelAndView gotoWebSocket(@PathVariable("id") Integer id, Integer who) {
		ModelAndView mv = new ModelAndView();
		mv.addObject("id", id);
		mv.addObject("who", who);
		// mv.setViewName("thymeleaf/websocket2");
		mv.setViewName("websocket2");
		return mv;
		// return "thymeleaf/websocket2";
	}

	@RequestMapping("/testwebsockett/{id}")
	public ModelAndView gotoWebSockett(@PathVariable("id") Integer id) {
		ModelAndView mv = new ModelAndView();
		mv.addObject("id", id);
		mv.setViewName("websocket3");
		return mv;
		// return "thymeleaf/websocket2";
	}
}
